﻿namespace OboutInc.EasyMenu_Pro
{
    using System;
    using System.Collections;
    using System.ComponentModel;
    using System.Reflection;
    using System.Web.UI;

    [Serializable, ToolboxItem(false)]
    public class EasyMenusCollection : CollectionBase, INamingContainer
    {
        public int Add(EasyMenu easyMenu)
        {
            return base.InnerList.Add(easyMenu);
        }

        public int AddAt(EasyMenu easyMenu, int index)
        {
            ArrayList list = (ArrayList) base.InnerList.Clone();
            base.InnerList.Clear();
            base.InnerList.AddRange(list.GetRange(0, index));
            int num = base.InnerList.Add(easyMenu);
            base.InnerList.AddRange(list.GetRange(index, list.Count - index));
            return num;
        }

        public int getIndexOf(EasyMenu easyMenu)
        {
            for (int i = 0; i < base.Count; i++)
            {
                if (this[i] == easyMenu)
                {
                    return i;
                }
            }
            return -1;
        }

        public void Remove(EasyMenu easyMenu)
        {
            base.InnerList.Remove(easyMenu);
        }

        public void Remove(int index)
        {
            base.InnerList.RemoveAt(index);
        }

        public EasyMenu this[int index]
        {
            get
            {
                return (EasyMenu) base.List[index];
            }
            set
            {
                base.List[index] = value;
            }
        }
    }
}

